import service from '../utils/request.js'; // 引入二次封装的 axios

// 资讯信息管理(管理端)
export const addInfoNews = (infoNews) => {
    return service.post('/api/admin/infoNews/add', infoNews);
};

export const deleteInfoNewsById = (id) => {
    return service.post(`/api/admin/infoNews/delete/${id}`);
};

export const getInfoNewsById = (id) => {
    return service.get(`/api/admin/infoNews/detail/${id}`);
};

export const listInfoNews = (infoNewsDto) => {
    return service.post('/api/admin/infoNews/list',  infoNewsDto);
};

export const updateInfoNews = (infoNewsDto) => {
    return service.post('/api/admin/infoNews/update', infoNewsDto);
};

export const batchDeleteInfoNews = (ids) => {
    return service.post('/api/admin/infoNews/batchDelete', ids );
};

// 资讯信息管理(管理端)
export const listByLatestOrHot = (id) => {
    return service.get(`/api/client/infoNews/latestOrHot/${id}`);
};
export const queryPageByCategory = (infoNewsDto) => {
    return service.post('/api/client/infoNews/listByCategory', infoNewsDto);
};

export const getClientInfoNewsById = (id) => {
    return service.get(`/api/client/infoNews/detail/${id}`);
};